package com.czh.auth.infra.basic.service.impl;

import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.czh.auth.infra.basic.mapper.AuthUserMapper;
import com.czh.auth.infra.basic.entity.AuthUser;
import com.czh.auth.infra.basic.service.AuthUserService;
import org.springframework.stereotype.Service;

import java.util.List;
import lombok.RequiredArgsConstructor;

/**
 * 用户信息表(AuthUser)表服务实现类
 *
 * @author caozaihui
 * @since 2024-08-28 09:18:54
 */
@Service("authUserService")
@RequiredArgsConstructor
public class AuthUserServiceImpl extends ServiceImpl<AuthUserMapper, AuthUser> implements AuthUserService {
       
 
        /** 
         * 
         * @param  id 主键
         * @author caozaihui  
         * @description //TODO  通过ID查询单条数据
         * @date 2024-08-28 09:18:54
         * @return 实例对象
         */
        @Override
        public AuthUser selectAuthUserById (Long id) {
                return baseMapper.selectById(id);
        }
        
        /** 
         * 
         * @param authUser 实例对象
         * @author caozaihui  
         * @description //TODO  分页查询数据
         * @date 2024-08-28 09:18:54
         * @return 实例对象
         */
        @Override
        public List<AuthUser> queryAuthUserList (AuthUser authUser) {
            return baseMapper.selectAuthUserList(authUser);     
        }
        
        /** 
         * 
         * @param authUser 实例对象
         * @author caozaihui  
         * @description //TODO  新增数据
         * @date 2024-08-28 09:18:54
         * @return 实例对象
         */
        @Override
        public int insert(AuthUser authUser) {
               return baseMapper.insert(authUser);
        }
        
        
        /** 
         * 
         * @param authUser 实例对象
         * @author caozaihui  
         * @description //TODO  修改数据并返回
         * @date 2024-08-28 09:18:54
         * @return 实例对象
         */
        @Override
        public int update(AuthUser authUser) {
                return  baseMapper.updateByUserName(authUser);
        }
        
        
        /**
         *
         * @param idList 主键
         * @author caozaihui 
         * @description //TODO    通过主键删除数据
         * @date 2024-08-28 09:18:54
         * @return
         */
        @Override
        public int deleteByIds(List<Long> idList) {
            return baseMapper.deleteByIds(idList);
        }

        @Override
        public int deleteById(Long id) {
               return baseMapper.deleteById(id);
        }

        @Override
        public int queryUserCountByCondition(AuthUser authUser) {
                return baseMapper.countByCondition(authUser);
        }

        @Override
        public List<AuthUser> getUserInfoList(List<String> userNameList) {
                return baseMapper.batchSelectAuthUserList(userNameList);
        }

}

